5

I want to display 2 columns using HTML (responsive). The 1st column, the name of the event whereas the 2nd column is the time of the event. How do I go about this? Below is the screenshot I have attached.

Screenshot

Aditya R
  • 567
  • 4
  • 17
Sabrina Said
  • 67
  • 1
  • 2
  • 10

6 Answers6

5

This is a piece of cake with Bootstrap.

    <div class="container">
        <div class="row">
            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                First Column
            </div>
            <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
                Second Column
            </div>
        </div>
    </div>
Jim W
  • 4,866
  • 1
  • 27
  • 43
3

You can achieve this by using "table" tag:

<table>
  <tr>
    <td>column 1</td>
    <td>column 2</td>
  </tr>
</table>
Rob
  • 2,243
  • 4
  • 29
  • 40
1

You have to create a container, add a row, and create two columns in that row.

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
  <div class="row">
    <div class="col">
      Column 1
    </div>
    <div class="col">
      Column 2
    </div>
  </div>
</div>

Read more about the Bootstrap grid system, including how to resize columns, here: https://getbootstrap.com/docs/4.0/layout/grid/

Aditya R
  • 567
  • 4
  • 17
0

Create a container then put it inside the column. The whole width of a browser is equals to 12 columns, if you want two columns then divide the 12 columns by 2 so the answer is 6 columns. This is an example of a responsive bootstrap 2 columns.

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">


<div class="container">
    <div class="col-lg-6 col-md-6  col-sm-12" style="background-color: red">
      Column 1
    </div>
    <div class="col-lg-6 col-md-6  col-sm-12" style="background-color: green">
      Column 2
    </div
<div>

Output: enter image description here

Yinkci Heart
  • 160
  • 1
  • 14
0
<div class="container">
    <div class="col-lg-6 col-md-6 >
      Column 1
    </div>
    <div class="col-lg-6 col-md-6 >
      Column 2
    </div
<div>
-4

You need to use a table. Something like this:

<!DOCTYPE html>
<html>
<body>

<table style="width:100%">
  <tr>
    <th>Name</th>
    <th>Time</th> 
  </tr>
  <tr>
    <td>Text</td>
    <td>Text</td>   
  </tr>
  <tr>
    <td>Text</td>
    <td>Text</td>  
  </tr>
  <tr>
    <td>Text</td>
    <td>Text</td>
  </tr>
</table>

</body>
</html>