CSS Styling Tables | html table css width
ThelookofanHTMLtablecanbegreatlyimprovedwithCSS:CompanyContactCountryAlfredsFutterkisteMariaAndersGermanyBerglundssnabbköpChristinaBerglundSwedenCentrocomercialMoctezumaFranciscoChangMexicoErnstHandelRolandMendelAustriaIslandTradingHelenBennettUKKöniglichEssenPhilipCramerGermanyLaughingBacchusWinecellarsYoshiTannamuriCanadaMagazziniAlimentariRiunitiGiovanniRovelliItalyTryitYourself»[1]TableBordersTospecifytablebordersinCSS,usetheborderproperty.Theexamplebelowspecifiesasolidborderfor
The look of an HTML table can be greatly improved with CSS:
Company Contact Country Alfreds Futterkiste Maria Anders Germany Berglunds snabbköp Christina Berglund Sweden Centro comercial Moctezuma Francisco Chang Mexico Ernst Handel Roland Mendel Austria Island Trading Helen Bennett UK Königlich Essen Philip Cramer Germany Laughing Bacchus Winecellars Yoshi Tannamuri Canada Magazzini Alimentari Riuniti Giovanni Rovelli Italy Try it Yourself »[1] Table BordersTo specify table borders in CSS, use the border property.
The example below specifies a solid border for <table>, <th>, and <td> elements:
Firstname Lastname Peter Griffin Lois Griffin Full-Width TableThe table above might seem small in some cases. If you need a table that should span the entire screen (full-width), add width: 100% to the <table> element:
Firstname Lastname Peter Griffin Lois Griffin Double Borders...