How do I use CSS to set borders on a table's labels only

Source: Internet
Author: User
A lot of friends are very distressed table style how to set, today will give you a detailed explanation of CSS table style how to set. Let's start with a way to set a border on table only. And then give you a way to set other elements of the table, keep your eye on

Setting the border (border) style only on the table label will give the table a border at the outermost table and no border style inside the table.

The case details are as follows:

1. Corresponding CSS code

<style>. Table-a table{border:1px Solid #F00}//CSS comment: Set the red border style only for table labels */</style>

2. Corresponding HTML code fragment

1. Corresponding CSS code

<style>. Table-a table{border:1px Solid #F00}//CSS comment: Set the red border style only for table labels */</style>

2. Corresponding HTML code fragment

<div class= "Table-a" > <table width= "" "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "> <tr> <td Width= "" > Station name </td> <td width= "181" > URL </td> <td width= "A" > Description </td> </tr> <tr> <td>PHP</td> <td>www.php.cn</td> <td>css learning </td> </tr> <tr > <td>CSS5</td> <td>www.php.cn</td> <td>css </td> </tr> </table > </div>

This is the way CSS only sets the border on the table's label, have you learned it?

Related reading:

Use div and CSS as drop-down menus

CSS3 Implementing a Shadow effect instance

Some points to be aware of in CSS layout

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.