How to Set the Width of an HTML Table to Fit the Screen?

Praveen Kumar Ganesan
Praveen Kumar Ganesan
Praveen Kumar Ganesan also called as GPKUMAR is the visionary Founder of Inavit Studio and Inavitnews, where technology meets storytelling. With a passion for innovation and...
1 Min Read

HTML tables can be puzzling for an HTML newbie. HTML alignment tricks are very simple once you get the hang of them.

This article will show the code needed to make an HTML table fit the screen by setting the width.

How To Make an HTML Table Fit the Screen

Set the width to 100%, so that your code will look like this:

<table width="100%" border="0" cellspacing="0" cellpadding="0">  
<tr>  
      <td>My html table is set to fit the screen</td>  
</tr>  
</table>

This little block of code will set the width to fit the screen. If you want to align your content, you should use a nested table.

Share This Article
Praveen Kumar Ganesan also called as GPKUMAR is the visionary Founder of Inavit Studio and Inavitnews, where technology meets storytelling. With a passion for innovation and digital transformation, Praveen blends creativity with strategic thinking to craft compelling tech, gaming, and news content that resonates with a global audience.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x