PhpStorm 2017.2.4中table标签bordercolor属性代码补全缺失求助
Why PhpStorm 2017.2.4 Doesn't Show
bordercolor Autocomplete & How to Fix It Hey there, let's unpack what's going on here and get you sorted out:
What's Causing the Issue?
- IDE's Bias for Modern Standards: PhpStorm (even the 2017.2.4 version) is built to prioritize web-standard practices. The
bordercolorattribute was deprecated in HTML4 and fully removed in HTML5, so the IDE's autocomplete system hides these "non-recommended" properties by default—even when you switch to HTML 4.0 mode. DreamWeaver, by contrast, leans into supporting legacy web workflows, which is why it displays the attribute. - Autocomplete Filter Rules: Switching the HTML language level fixes validation warnings, but it doesn't automatically adjust what shows up in autocomplete. PhpStorm likely filters out deprecated items from the suggestion list by default.
- HTML Version Nuance: You set the language level to HTML 4.0, but
bordercoloris officially part of the HTML 4.01 spec (not the earlier 4.0). This small difference might be throwing off the IDE's autocomplete logic.
Fixes to Try
Option 1: Make PhpStorm Show bordercolor in Autocomplete
If you really need to use the bordercolor attribute, follow these steps:
- Go to
File | Settings | Editor | General | Code Completion - Look for an option like Show deprecated items (or "Include deprecated symbols" in older PhpStorm builds) and check the box
- Double-check your HTML schema: Go to
File | Settings | Languages & Frameworks | Schemas and DTDs, set the default HTML schema to HTML 4.01 Transitional (not 4.0), then restart PhpStorm
After this,bordercolorshould appear in the autocomplete list when editing<table>tags.
Option 2: Use CSS (Recommended, Standards-Compliant Approach)
Since bordercolor is deprecated (meaning it could break in future browser updates), using CSS is the better long-term solution. Here's how to apply a unique border color to your target table:
- Add a custom class to your table:
<table class="custom-border-table"> <!-- table content here --> </table>
- Add this CSS to your stylesheet:
/* Optional: Merge cell borders for a cleaner look */ .custom-border-table { border-collapse: collapse; width: 100%; } /* Style all cells in the table */ .custom-border-table td, .custom-border-table th { border: 1px solid #ff4500; /* Replace with your desired color */ padding: 8px; /* Add padding for readability */ } /* Optional: Add a thicker outer border for the table */ .custom-border-table { border: 2px solid #0066cc; }
This method is more flexible (you can target specific cells, rows, or the whole table separately) and won't trigger any IDE warnings.
内容的提问来源于stack exchange,提问作者harix
相关产品推荐
相关产品推荐

