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.
Asked
Active
Viewed 5.1k times
5
-
1Are you using vanilla HTML or a CSS framework (Bootstrap, etc)? – Aditya R Oct 29 '17 at 04:18
-
I am using Bootstrap to develop this. – Sabrina Said Oct 29 '17 at 04:21
-
Can't understand why you don't know about grid layout system of Bootstrap: http://getbootstrap.com/docs/4.0/layout/grid/ – Argus Duong Oct 29 '17 at 04:34
-
I am a newbie so I don't really understand how the grid system works @AnhTuan – Sabrina Said Oct 29 '17 at 05:08
6 Answers
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

Yogesh Choudhary Paliyal
- 604
- 1
- 8
- 23
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
-
1
-
-
then what about the ceret down icon next to the column 2? do I need to add a new column for that also? @AppleCrazy – Sabrina Said Oct 29 '17 at 05:12
-
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>

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>

Will Ansell
- 1
- 4