How I can format <table> like this, using CSS?

Hi,

What I want is very clear as you can in the caption of the both images. :slight_smile:

This is how I actually want the output when I execute my HTML file, when I use <table> and <th> tag in the page because I want to show the results beside the form i.e. in the white space.

The PROBLEM

This is how I’m getting the output when I use <table> and <th> in my HTML page.

What I want?

Even when I use <table> and <th> tag in my HTML page I want output like the first image. How can I achieve this using CSS?

Thanks!

That doesn’t look like tabular data, so i would not use <table>
CSS display: table can put things side by side.

3 Likes
html, body, table { height: 100%; }

That should do. But I’d listen to Sam and don’t use tables for layout.

I would not use tables at all for such a layout. Tables are hard to transform into responsive layouts.
Instead use regular div and style them with CSS accordingly.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.