CodeSolved

Solved Programming Questions & Exercises

People's list table

Practice Easy 201/ Download 1170 Views

Create a table and put the following people's information including name, city and age

Amir Hossein Tehran 23
Houshang Tehran 48
Leila Arak 39
Mehdi Qom 12
Zahra Mazandaran 33
Hussein Hamedan 56

14 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="kam.css">
    <style>
        *{
            margin: 0%;padding: 0%;box-sizing: border-box;
        }
    th,td{
            border: 1px solid black;width: 100px;text-align: center;
        }
    th{
            background-color: rgb(253, 92, 18);
        }
    td{
            background-color: rgb(252, 242, 158);
        }
    </style>
</head>
<body>
    <table style="border-collapse: collapse;">
        <tr>
            <th>اسم</th>
            <th>شهر</th>
            <th>سن</th>
        </tr>
        <tr>
            <td>امیرحسین</td>
            <td>تهران</td>
            <td>23</td>
        </tr>
        <tr>
            <td>هوشنگ</td>
            <td>تهران</td>
            <td>48</td>
        </tr>
        <tr>
            <td>لیلا</td>
            <td>اراک</td>
            <td>39</td>
        </tr>
        <tr>
            <td>مهدی</td>
            <td>قم</td>
            <td>12</td>
        </tr>
        <tr>
            <td>زهرا</td>
            <td>مازندران</td>
            <td>33</td>
        </tr>
        <tr>
            <td>حسین</td>
            <td>همدان</td>
            <td>56</td>
        </tr>
    </table>
</body>
</html>
Zaras Download HTML & CSS
person = [
    {
        "name": "amir hosein" , "city": "tehran" , "age": 23
    },{
        "name": "hooshang" , "city": "tehran" , "age": 48
    },{
        "name": "leyla" , "city": "arak" , "age":  39
    },{
        "name": "mehdi" , "city": "qome" , "age": 12
    },{
        "name": "zahra" , "city": "mazandaran" , "age": 33
    },{
        "name": "hosein" , "city": "hamedan" , "age": 56
    },{
        "name": "arman" , "city": "amirkola" , "age": 24
    },{
        "name": "iman" , "city": "sari" , "age": 38
    }
]
print(person[0]["name"])
print(person[1]["name"])
print(person[2]["name"])
Sumy.amiri Download Python
import pandas as pd

# Data
data = {
    'اسم': ['امیرحسین', 'هوشنگ', 'لیلا', 'مهدی', 'زهرا', 'حسین'],
    'شهر': ['تهران', 'تهران', 'اراک', 'قم', 'مازندران', 'همدان'],
    'سن': [23, 48, 39, 12, 33, 56]
}

# Create Dataframe
df = pd.DataFrame(data)

# Display the table
print(df)
User 136 Download Python
names['حسین','زهرا','مهدی','لیلا','هوشنگ','امیرحسین']
city=['همدان','مازندران','قم','اراک','تهران','تهران']
sen=[23,48,39,12,33,56]
i=0
while i<len(names):
    print(names[i],sen[i],city[i],end=' ')
    i+=1
    print('')
name=["امیرحسین","هوشنگ","لیلا","مهدی","زهرا","حسین"]
city=["تهران","تهران","اراک","قم","مازندران","همدان"]
age=[23,48,39,12,33,56]
for i in range(len(name)):
    print(name[i],city[i],age[i])
Yasin.hn Download Python
<!DOCTYPE html>
<html lang="fa">
    <head>
        <title> جدول</title>
        <style>
            table{
                background-color: bisque;
                margin-left: auto;
                margin-right: auto;
                text-align: center;
                border: 2px solid #000000;
                padding: 3px;
                border-radius: 10px;
            }
            td{
                background-color: azure;
                border: 1px solid #000000;
                padding: 4px;
                border-radius: 10px; 
                width: 50px;
            }
        </style>
    </head>
    <body>
        <table >
            <tr>
                <th>name</th>
                <th>city</th>
                <th>age</th>
            </tr>
            <tr>
                <td>امیرحسین</td>
                <td>تهران</td>
                <td>23</td>
            </tr>
            <tr>
                <td>هوشنگ</td>
                <td>تهران</td>
                <td>48</td>
            </tr>
            <tr>
                <td>لیلا</td>
                <td>اراک</td>
                <td>39</td>
            </tr>
            <tr>
                <td>مهدی</td>
                <td>قم</td>
                <td>12</td>
            </tr>
            <tr>
                <td>زهرا</td>
                <td>مازندران</td>
                <td>33</td>
            </tr>
            <tr>
                <td>حسین</td>
                <td>همدان</td>
                <td>56</td>
            </tr>
        </table>  
        
    </body>
</html>
*.*.*.*.*.*.*.*.* CSS *.*.*.*.*.*.*.*.*
    <style>
        body {
          background: #171b26;
        }

        div {
          width: 90%;
          background-color: #293143;
          margin: auto;
          border-radius: 10px;  
        }

        table {
            width: 95%;
            border-collapse: collapse;
            margin: 40px auto;
        }
        
        th, td {
            padding: 5px;
            text-align: center;
            border-bottom: 2px solid #232a39;
        }

        tr {
            background: #293143; 
            color: #ffffff;  
        }

        th {
            background-color: #293143;
            color: #fb4b83;
        }

        tr:hover {
            background-color: #343e56;
        }
    </style>

-_-_-_-_-_-_-_ HTML _-_-_-_-_-_-_-_-_
  <div>
    <table>
        <tr>
          <th>سن</th>
          <th>شهر</th>
          <th>نام</th>
        </tr>
        <tr>
          <td>23</td>
          <td>تهران</td>
          <td>امیرحسین</td>
        </tr>
        <tr>
          <td>48</td>
          <td>تهران</td>
          <td>هوشنگ</td>
        </tr>
        <tr>
          <td>39</td>
          <td>اراک</td>
          <td>لیلا</td>
        </tr>
        <tr>
          <td>12</td>
          <td>قم</td>
          <td>مهدی</td>
        </tr>
        <tr>
          <td>33</td>
          <td>مازندران</td>
          <td>زهرا</td>
        </tr>
        <tr>
          <td>56</td>
          <td>همدان</td>
          <td>حسین</td>
        </tr>
    </table>
  </div>
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close