Hi everybody
I want to make a border of frame on my website. So how to make it?

Dani AI

Generated

Earlier replies by and suggest using old HTML frames (<frameset>/<frame>) to add a border. That approach is not the right tool for putting a border around a table (and frames are obsolete for modern sites). Frames were used to split pages into separate panes, but they are deprecated — use normal layout/CSS or an <iframe> only when embedding another page. (developer.mozilla.org)

For a table border, use CSS on the table and its cells instead of HTML attributes. A simple, modern pattern is to collapse the internal borders and then add borders to the table and to th/td as needed:

<table class="my-table">
  <thead><tr><th>Head 1</th><th>Head 2</th></tr></thead>
  <tbody><tr><td>Cell 1</td><td>Cell 2</td></tr></tbody>
</table>

<style>
.my-table { border-collapse: collapse; border: 2px solid #444; }
.my-table th, .my-table td { border: 1px solid #bbb; padding: 8px; }
</style>

Use border-collapse: collapse for single shared lines between cells; use border-spacing and border-collapse: separate when wanting gaps between cells. The HTML border attribute (and related table attributes like cellspacing) is obsolete — prefer CSS for styling. (developer.mozilla.org)

If borders don't appear, check for these common issues: a CSS reset or global rule may be overriding borders; border-style defaults to none so a width alone won't show a line (set border: 1px solid ... or border-style). For an outer-only box around the whole table, put the border on the <table> and leave cell borders unset. Use browser DevTools to inspect which rule wins. (developer.mozilla.org)

In short: stop using frames for this; style tables with CSS (border-collapse + border on table/th/td) for predictable, future-proof results. (developer.mozilla.org)

Recommended Answers

All 5 Replies

 <!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
 <frameset cols="50%,50%">
  <frame src="frame_a.htm" frameborder="0">
  <frame src="frame_b.htm" frameborder="2">
</frameset> 
</body>
</html> 

see this code and try..

Can you clarify your question please?

try this!

<!DOCTYPE html>
<html>

<frameset cols="100%">
  <frame src="frame_a.htm" style="border:medium double rgb(0,0,255)">

</frameset>

</html>

use css to apply frame border and style.

Why not use the w3schools site?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.